<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"+ request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE html>
<html>
  <head>
    <script src="<%=basePath%>resources/js/param.js" ></script>
    <script src="<%=basePath%>resources/js/jquery/jquery-1.9.0.min.js"></script>    
  </head>
  <body>
    <form id="loginForm" name="loginForm" action="<%=basePath%>j_spring_security_check"  method="post">
      <input type="hidden" name="j_password" id="j_password" value="">
      <input type="hidden" name="j_username" id="j_username" value="">
      <input type="hidden" name="j_username" id="j_username" value="">
      <input type="hidden" name="j_redirecturi" id="j_redirecturi" value="">
    </form>
  </body>
  <script>
      function login(){
        var j_username = getParam("j_username");
        var j_password = getParam("j_password");
        var j_redirecturi = getParam("j_redirecturi");
        if(j_username && j_password){
          $("#j_username").val(j_username);
          $("#j_password").val(j_password);
          $('#j_redirecturi').val(j_redirecturi);
          $("#loginForm").submit();
        }else{
          windows.location.href="<%=basePath%>home";
        }
      }

      $(document).ready(function(){
        login();
      });
    </script>
</html>